home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2007 December / PCWKCD1207B.iso / Blogowanie poza sfera / Scribefire-1.4.2 / scribefire-1.4.2-fx+fl.xpi / chrome / content / clipboard.js < prev    next >
Encoding:
Text File  |  2006-10-06  |  3.7 KB  |  85 lines

  1. function goDoCommand(command)
  2. {
  3.   try {
  4.     var controller = top.document.commandDispatcher.getControllerForCommand(command);
  5.     if ( controller && controller.isCommandEnabled(command))
  6.       controller.doCommand(command);
  7.   }
  8.   catch (e) {
  9.     dump("An error occurred executing the "+command+" command\n");
  10.   }
  11. }
  12.  
  13. function performancing_cut() {
  14.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  15.         var midas = document.getElementById("performancing-message");
  16.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  17.         HTMLEditor.cut();
  18.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  19.         goDoCommand("cmd_cut");
  20.     }
  21. }
  22. function performancing_paste() {
  23.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  24.         var midas = document.getElementById("performancing-message");
  25.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  26.         HTMLEditor.paste(1);
  27.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  28.         goDoCommand("cmd_paste");
  29.     }
  30. }
  31. function performancing_copy() {
  32.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  33.         var midas = document.getElementById("performancing-message");
  34.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  35.         HTMLEditor.copy();
  36.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  37.         goDoCommand("cmd_copy");
  38.     }
  39. }
  40. function performancing_pastenoformatting() {
  41.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  42.         var midas = document.getElementById("performancing-message");
  43.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  44.         HTMLEditor.pasteNoFormatting(1);
  45.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  46.         goDoCommand("cmd_paste");
  47.     }
  48. }
  49. function performancing_delete() {
  50.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  51.         var midas = document.getElementById("performancing-message");
  52.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  53.         HTMLEditor.deleteSelection(1);
  54.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  55.         goDoCommand("cmd_delete");
  56.     }
  57. }
  58. function performancing_undo() {
  59.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  60.         var midas = document.getElementById("performancing-message");
  61.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  62.         HTMLEditor.undo(1);
  63.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  64.         goDoCommand("cmd_undo");
  65.     }
  66. }
  67. function performancing_redo() {
  68.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  69.         var midas = document.getElementById("performancing-message");
  70.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  71.         HTMLEditor.redo(1);
  72.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  73.         goDoCommand("cmd_redo");
  74.     }
  75. }
  76.  
  77. function performancing_selectAll() {
  78.     if (document.getElementById("performancing-editor-tabbox").selectedIndex == 0) {
  79.         var midas = document.getElementById("performancing-message");
  80.         var HTMLEditor = midas.getHTMLEditor(midas.contentWindow);
  81.         HTMLEditor.selectAll();
  82.     } else if (document.getElementById("performancing-editor-tabbox").selectedIndex == 1) {
  83.         goDoCommand("cmd_selectAll");
  84.     }
  85. }